import get from '@dfeidao/atom-web/local/get';
import remove from '@dfeidao/atom-web/local/remove';
import render from '@dfeidao/atom-web/render/render';
import remove_node from '@dfeidao/atom-web/ui/remove-node';
import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';

import { IFeidaoAiBrowserComponent } from '@dfeidao/web/interfaces';
import P01 from './P01';
import P03 from './P03';
export default async function a001(fd: IFeidaoAiBrowserComponent) {
	//  调用事件
	fd.data.node.querySelector<HTMLDivElement>('[id="zj9"]').classList.add('display-n');

	const nodes = fd.data.node.querySelectorAll<HTMLDivElement>('[vlist]');
	nodes.forEach((i) => {
		set_node_cls(i, 'bg-c', false);

	});
	remove(fd, 'feild');
	const r_node = fd.data.node.querySelector<HTMLDivElement>('[data-feidao-presentation="P02"]');
	Array.from(r_node.childNodes).map((v: HTMLSpanElement) => {
		remove_node(v);
	});
	const res = get(fd, 'biaotou');
	render(fd, res, P01, 'P01', 'inner');
	fd.data.node.querySelector<HTMLDivElement>('[data-feidao-presentation="P05"]').innerHTML = '';
	fd.data.node.querySelector<HTMLDivElement>('[data-feidao-presentation="P04"]').innerHTML = '';
	render(fd, '', P03, 'P03', 'inner');
}
